function deepClone(data) {
    let result;
    if (Object.prototype.toString.call(data) === "[object Array]") {
        result = [];
        data.forEach((item, index) => {
            if (typeof item === 'object') {
                result[index] = deepClone(item);
            } else {
                result[index] = item;
            }
        });
    } else if (Object.prototype.toString.call(data) === "[object Object]") {
        result = {};
        for (let key in data) {
            if (Object.prototype.hasOwnProperty.call(data, key)) {
                result[key] = typeof data[key] === 'object' ? deepClone(data[key]) : data[key];
            }
        }
    } else {
        result = data;
    }
    return result;
}

let arr1 = [1, [2, 3, 4], 5, {a:1, b:2, c:[4, 5, 6]}];
let arr2 = deepClone(arr1);
arr1[1][2] = 9;
arr1[3].a = 100;
console.log(arr2[1][2]); // 4
console.log(arr2[3].a); // 1
